<?=view('home.common.header')?>
<?=view('home.common.nav')?>
<div class='container'>
    <div class='container-fluid'>
        <div class='row'>
            <div class='col-xs-12 col-md-12' style='padding: 15px 0px;'>
                <input type='text' name='payphone' class='input form-control' placeholder="请输入代付人手机号" style='margin-bottom: 15px;'>
                <a href='<?=url('home/index/dorder')?>' class='button button-action form-control eveDpay' onclick='return false;'>让他代付</a>
            </div>
        </div>
    </div>
</div>
<script>
    $('.eveDpay').click(function(){
        var reg = /^1[3587]\d{9}$/;
        if ($('input[name=payphone]').val() == '' || !reg.test($('input[name=payphone]').val())) {
               alert('请填写正确的联系人电话');
               $('input[name=payphone]').focus();
               return false;
        }
        var url = $(this).attr('href');
        data = {'payphone': $('input[name=payphone]').val(), 'order':'<?=$result->order?>'};
        $.get(url, data, function(data) {
            layer.open({
                content: data.info,
                style: 'background-color:#3E403E; color:#fff; border:none;',
                time: 1
            });
            setTimeout(function(){
                window.location.href="<?=url("home/index/index") ?>";
            },1000);
        });
        return false;
    });
</script>
<?=view('home.common.header')?>
